<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<jsp:include page="../commons/top.jsp" />
<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript">
	$(function(){
		$("#listContent132").width(document.body.offsetWidth-20);
	});
	// 查询
	function reportSearch(){
		
		$("#reportForm").attr("action","<c:url value="/report/day/list" />");
		$("#reportForm").submit();
	}
	// 重置
	function reportReset() {
		
		window.location.href = "<c:url value="/report/day/list" />?pageNo="+1;
	}
	// 导出
	function reportPrint(){
		
		$("#reportForm").attr("action","<c:url value="/report/day/print" />");
		$("#reportForm").submit();
	}
</script>
<div id="breadCrumbDiv">
	<span class="main_title"><a href="main.html">首页</a></span>
	<span class="main_title"><a href="#">报表</a></span>
	<span class="main_title"><a href="#">销售报表</a></span>
</div>
<div id="workAreaDiv">
	<div id="organizationListDiv">
		<form id="reportForm" action="" method="post">
		<table border="0" cellpadding="0" cellspacing="0" width="100%" class=""> 
	    <tr> 
	    	<td class="table_title">查询</td> 
	    </tr>
	    <tr> 
      	<td> 
      		<table width="100%" cellpadding="1" cellspacing="1" border="0" class="table_border"> 
          	<tr class="table_display_1"> 
	            <td width="10%" class="table_display_2">开始日期</td> 
	            <td width="20%">
	            	<input id="startDate" name="startDate" style="width:100px;" value="${param.startDate}"
	            		class="Wdate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd',readOnly:true})">
	            </td> 
              <td width="10%" class="table_display_2">结束日期</td> 
              <td width="20%">
              	<input id="endDate" name="endDate" style="width:100px;" value="${param.endDate}"
              		class="Wdate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd',readOnly:true})">
	            </td> 
              <td width="10%" class="table_display_2">部门</td> 
              <td width="20%">
              	<select id="nodeCode" name="nodeCode">
              		<option value="">--全部--</option>
              		<c:forEach items="${nodeInfoList}" var="node">
              			<option value="${node.nodeCode}"
              				<c:if test="${param.nodeCode eq node.nodeCode}">selected</c:if>
              			>${node.nodeName}</option>
              		</c:forEach>
              	</select>
              </td> 
           	</tr> 
           </table>
        </td> 
      </tr> 
    	<tr align="right" class="btnTR"> 
	      <td> 
	      	<input type="button" onclick="reportSearch()" value="查询">&nbsp;
		      <input type="button" onclick="reportReset()" value="重置"/> 
	      </td> 
    	</tr> 
    </table>
    </form> 
    <br/> 
		<table border="0" cellpadding="0" cellspacing="0" width="100%" class=""> 
			<tr> 
				<td class="table_title" colspan="2">销售日报表</td>
			</tr>
			<tr class="btnTR">
				<td> 
					<input type="button" onclick="reportPrint()" value="EXCEL"/>
				</td> 
				<td align="right"> 
					<jsp:include page="../commons/page.jsp" flush="true">
						<jsp:param name="url" value="/report/day/list" />
						<jsp:param name="formId" value="reportForm" />
					</jsp:include>
				</td>
			</tr> 
			<tr> 
				<td colspan="2" id="listContent132"> 
					<table width="2000px" cellpadding="1" cellspacing="1" border="0" class="table_border"> 
						<tr class="table_header_on" align="center">
							<td>创建日期</td>
							<td>交易日期</td>
							<td>部门编码</td>
							<td>部门名称</td>
							<td>当日营业额</td>
							<td>累计营业额</td> 
							<td>日增长额</td>
							<td>团购金额累计</td>
							<td>达成率</td>
							<td>去年比</td>
							<td>日均</td>
							<td>来客数</td>
							<td>客单价</td>
							<td>毛利额</td>
							<td>成交率（%）</td> 
							<td>毛利率（%）</td>
							<td>损耗额</td>
							<td>损耗率（%）</td>
							<td>折扣额</td>
							<td>折扣率（%）</td>
							<td>库存额</td>
							<td>回转天数</td>
							<td>维护日期</td>
						</tr> 
						<c:if test="${!empty reports}">
							<c:forEach items="${reports}" var="report">
								<tr class="table_display_1">
									<td align="center"><c:out value="${report.createDate}"></c:out></td>
									<td align="center"><c:out value="${report.occurDate}"></c:out></td>
									<td align="center"><c:out value="${report.nodeCode}"></c:out></td>
									<td align="center"><c:out value="${report.nodeName}"></c:out></td>
									<td align="center"><c:out value="${report.saleEarning}"></c:out></td>
									<td align="center"><c:out value="${report.saleEarningTotal}"></c:out></td>
									<td align="center"><c:out value="${report.growthAmount}"></c:out></td>
									<td align="center"><c:out value="${report.saleMoney}"></c:out></td>
									<td align="center"><c:out value="${report.achieveRate}"></c:out></td>
									<td align="center"><c:out value="${report.onlyYoy}"></c:out></td>
									<td align="center"><c:out value="${report.averageDaily}"></c:out></td>
									<td align="center"><c:out value="${report.saleCount}"></c:out></td>
									<td align="center"><c:out value="${report.customerUnivalence}"></c:out></td>
									<td align="center"><c:out value="${report.saleAgio}"></c:out></td>
									<td align="center"><c:out value="${report.transactionRate}"></c:out></td>
									<td align="center"><c:out value="${report.saleAgioRate}"></c:out></td>
									<td align="center"><c:out value="${report.purchMoneyExt}"></c:out></td>
									<td align="center"><c:out value="${report.purchMoneyRate}"></c:out></td>
									<td align="center"><c:out value="${report.saleGrossProfit}"></c:out></td>
									<td align="center"><c:out value="${report.saleGrossProfitRate}"></c:out></td>
									<td align="center"><c:out value="${report.endMoney}"></c:out></td>
									<td align="center"><c:out value="${report.turnDay}"></c:out></td>
									<td align="center"><c:out value="${report.maintenanceDate}"></c:out></td>
								</tr>
							</c:forEach>
						</c:if>
					</table> 
				</td> 
			</tr> 
		</table> 
	</div>
</div>
<jsp:include page="../commons/bottom.jsp" />